In networking systems, classification engines can be used to determine an action to perform and/or a rule to apply to a particular packet. Such classification can include the use of a lookup function, which can be implemented as a hardware “search engine” or the like. Such search engines can include content addressable memory (CAM) and/or a standard memory, such as static random access memory (SRAM). The standard memory is commonly accessed using “hashing” to essentially provide a “many-to-one” function. Such an approach can allow for a smaller memory size so that overall system costs can be reduced. Further, types of CAM include “ternary” CAM, which can allow for matching one of three possible storage states: 0, 1, or “x” (i.e., a “don't care” term).
A search key applied to a search engine, such as a TCAM, can result in several “hit” or “miss” indications. If the search key is found (i.e., a “match” occurs) at multiple locations within the TCAM, a priority or “precedence” determination must be employed in order to provide an overall winner. Referring now to FIG. 1A, a block diagram of a conventional precedence determination using physical address based priority in a TCAM is shown and indicated by the general reference character 100. The search key “Key” can be applied to TCAM 102, which contains a number of entries: Entry 104-0, 104-1, 104-2, . . . Entry 104-N. If the search key matches more than one entry in TCAM 102, search result signals 106 will provide the multiple hit indications to Precedence Determination 108. Of course, this precedence determination may be integrated within the TCAM chip. In any event, the determination in this example is based purely on physical address location. For example, if Entry 104-0 and Entry 104-2 have hit indications, because the address of location 104-0 is lower than the address of 104-2, Entry 104-0 is provided as Result_A by Precedence Determination 108.
More recently, TCAM solutions have incorporated programmable priority override mechanisms to allow for increased flexibility. Referring now to FIG. I B, a block diagram of a conventional precedence determination using a programmable override based priority in a TCAM is shown and indicated by the general reference character 120. In this example, TCAM 122 contains entries: Entry 124-0, 124-1, 124-2, . . . Entry 124-N. However, each entry is also paired with a corresponding priority override: PO 130-0, 130-1, 130-2, . . . PO 130-N. Here, if the search key matches more than one entry in TCAM 122, search result signals 126 will provide the multiple hit indications to Precedence Determination 128. In this example, if Entry 124-0 and Entry 124-2 have hit indications and if PO 130-2 has a higher priority than PO 130-0, Entry 124-2 is provided as Result_B by Precedence Determination 128 due to the programmable priority override.
While the programmable priority override approach affords increased flexibility for TCAM-based solutions, classification systems having both SRAM and TCAM cannot effectively take advantage of these features. Further, while users can typically shuffle or otherwise change the priority of TCAM entries, it is a more difficult operation to perform using SRAM entries, so a software precedence approach may be more desirable for SRAM. Consequently, what is needed is a precedence determination system supporting overall programmable precedence levels that is suitable for classification systems that have both SRAM and TCAM portions.